package com.tangyuan.live.controller;


import com.tangyuan.common.result.Result;
import com.tangyuan.live.entity.dto.LiveCommentDto;
import com.tangyuan.live.service.LiveCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("live/comment")
@RestController
public class LiveCommentController {

    @Autowired
    LiveCommentService liveCommentService;

    /**
     * 添加直播评论
     *
     * @param userId 用户ID，用于识别评论所属的用户
     * @param dto LiveCommentDto对象，包含直播评论的相关数据
     * @return 返回添加直播评论的结果
     */
    @PostMapping("/addLiveComment")
    public Result addLiveComment(@RequestHeader Long userId,@RequestBody LiveCommentDto dto){
        return Result.ok(liveCommentService.addLiveComment(userId,dto));
    }
}
